package com.tyk.bookstore.back.product.model.query;

import com.tyk.bookstore.back.product.model.constant.AuthorValidateConstant;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author tyk
 * @description 作者
 */
@Data
@Schema(name = "AuthorUpdateQuery", description = "作者")
public class AuthorUpdateQuery implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "ID")
    @NotNull
    @Min(value = 1)
    private Long id;

    @Schema(description = "名字")
    @NotBlank
    @Size(min = AuthorValidateConstant.NAME_MIN_LENGTH, max = AuthorValidateConstant.NAME_MAX_LENGTH)
    @Pattern(regexp = AuthorValidateConstant.NAME_REGEXP)
    private String name;

    @Schema(description = "描述")
    @NotBlank
    @Size(min = AuthorValidateConstant.DESCRIPTION_MIN_LENGTH, max = AuthorValidateConstant.DESCRIPTION_MAX_LENGTH)
    @Pattern(regexp = AuthorValidateConstant.DESCRIPTION_REGEXP)
    private String description;

}
